import request from '@/utils/request'
export function getAllCategory() {
    return request({
        url: "/admin/getAllCategory",
        method: 'get'
    })
}
export function delOneCategoryById(id) {
    return request({
        url: "/admin/delOneCategoryById",
        method: 'post',
        params: { id }
    })
}

export function addOneCategory(name) {
    return request({
        url: "/admin/addOneCategory",
        method: 'post',
        params: { name }
    })
}

export function editOneCategory(name, id) {
    return request({
        url: "/admin/addOneCategory",
        method: 'post',
        params: { name, id }
    })
}
//二级目录操作
export function addTwoCategory(name) {
    return request({
        url: "/admin/addTwoCategory",
        method: 'post',
        params: { name }
    })
}
export function editTwoCategory(name, id) {
    return request({
        url: "/admin/addTwoCategory",
        method: 'post',
        params: { name, id }
    })
}

export function delTwoCategoryById(id) {
    return request({
        url: "/admin/delTwoCategoryById",
        method: 'post',
        params: { id }
    })
}

export function getTwoCategoryById(id) {
    return request({
        url: "/admin/getTwoCategoryById",
        method: 'post',
        params: { id }
    })
}